package com.cqjtu.store.order.mapper;

import com.cqjtu.store.common.PageDTO;
import com.cqjtu.store.order.pojo.entity.Order;
import com.cqjtu.store.order.pojo.vo.OrderListVO;
import com.cqjtu.store.order.pojo.vo.OrderVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface OrderMapper {
    List<OrderVO> getOrderList(Integer userId);

    List<OrderVO> getOrderListByStatus(@Param("status") Integer status,@Param("id") Integer id);

    boolean createOrder(Order order);

    int getRealTimeNum(Date date);

    int getNumByDay(Date date);

    int getNumByDayAndUserProduct(@Param("date") Date date,@Param("userId") Integer userId,@Param("productId") Integer productId);

    OrderVO getEarliest(@Param("userId") Integer userId);

    int getNumByDayAndProduct(@Param("date") Date date,@Param("productId") Integer productId);

    int getNumByDayAndUser(@Param("date") Date date,@Param("userId") Integer userId);


    List<OrderListVO> getAllOrder(PageDTO pageDTO);

    List<OrderListVO> getOrderByKey(PageDTO pageDTO);

    int deleteOrder(@Param("id") Integer id);

    int deleteOrderItems(@Param("id") Integer id);

    int getAllOrderNum();

    int getKeyOrderNum(String key);
}
